package com.four.service.impl;



import com.four.dao.ProductMapper;
import com.four.pojo.Product;
import com.four.service.IProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

/**
 * @author version v1.0
 * @ClassName：
 * @Description：
 **/
@Service("productService")
public class ProductServiceImpl implements IProductService {
    @Autowired
    @Qualifier("productMapper")
    private ProductMapper productMapper;
    @Override
    public List<Product> findAllProduct() {
        return productMapper.findAllProduct();
    }


    @Override
    public int addProduct(Product product) {
        Date date = new Date();
        product.setPtime(date);
        return productMapper.addProduct(product);
    }

    @Override
    public int updateProductPstate(Product product) {
        return productMapper.updateProductPstate(product);
    }

    @Override
    public int deleteProduct(int pid) {
        return productMapper.deleteProduct(pid);
    }

    @Override
    public int updateProduct(Product product) {
        return productMapper.updateProduct(product);
    }

    @Override
    public Product findByProductId(int pid) {
        return productMapper.findByProductId(pid);
    }

    @Override
    public List<Product> findProductAll(Product product) {
        return productMapper.findProductAll(product);
    }

    @Override
    public List<Product> findProductOrders(Product product) {
        return productMapper.findProductOrders(product);
    }

    @Override
    public List<Product> findMemberByMid(String  pname) {
        return productMapper.findMemberByMid(pname);
    }

    @Override
    public List<Product> findMoney(Product product) {
        return productMapper.findMoney(product);
    }

    @Override
    public Product findAllMoney(Product product) {
        return productMapper.findAllMoney(product);
    }

    @Override
    public List<Product> findMoneyAll() {
        return productMapper.findMoneyAll();
    }

    @Override
    public int findMember(Product product) {
        return productMapper.findMember(product);
    }

    @Override
    public Integer findNian(Product product) {
        return productMapper.findNian(product);
    }

    @Override
    public Integer findKa(Product product) {
        return productMapper.findKa(product);
    }

    @Override
    public Integer findMemberProduce(Product product) {
        return productMapper.findMemberProduce(product);
    }

    @Override
    public Integer findMemberProduces(Product product) {
        return productMapper.findMemberProduces(product);
    }

    @Override
    public List<Product> findService() {
        return productMapper.findService();
    }

    @Override
    public Integer findAfter() {
        return productMapper.findAfter();
    }

    @Override
    public Integer findWei() {
        return productMapper.findWei();
    }

    @Override
    public List<Product> findCountWei() {
        return productMapper.findCountWei();
    }


}
